package com.example.demo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

/**
 * @Author: WinstonDeng
 * @Description:
 * @Date: Created in 18:08 2020/4/7
 * @Modified by:
 */

public class Flow {
    private long id;
    private long patientId;
    private long doctorId;
    private int warningScore;
    private int state;
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Timestamp createTime;
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Timestamp updateTime;
    private String flowPatientName;
    private String description;
    private String bedNum;
    private String hospNum;
    private long templeteId;

    private List<FlowStep> flowStepList;

    public static final String DESCRIPTION_DEFAULT = "暂无";
    public static final String BEDNUM_DEFAULT = "待分配";
    public static final String HOSPNUM_DEFAULT = "待分配";
    public static final Integer STATE_BREAK = 0;
    public static final Integer STATE_DOING = 1;
    public static final Integer STATE_FINISH = 2;

    public static final List<Integer> BASE_STEPS = Arrays.asList(1,2);
    public static final List<Integer> TEMP_STEPS_1 = Arrays.asList(3,4,5,6,7,8,9,10,11,12,13,14); // 介入手术
    public static final List<Integer> TEMP_STEPS_2 = Arrays.asList(3,4,5,6,7,15,16,17,18,19,20,14); // 非手术
    public static final List<Integer> TEMP_STEPS_3 = Arrays.asList(3,4,5,6,7,21,9,10,11,12,13,14); // 妇科介入

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getPatientId() {
        return patientId;
    }

    public void setPatientId(long patientId) {
        this.patientId = patientId;
    }

    public long getDoctorId() {
        return doctorId;
    }

    public void setDoctorId(long doctorId) {
        this.doctorId = doctorId;
    }

    public int getWarningScore() {
        return warningScore;
    }

    public void setWarningScore(int warningScore) {
        this.warningScore = warningScore;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    public String getFlowPatientName() {
        return flowPatientName;
    }

    public void setFlowPatientName(String flowPatientName) {
        this.flowPatientName = flowPatientName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getBedNum() {
        if(bedNum == null || bedNum.isEmpty()){
            bedNum = BEDNUM_DEFAULT;
        }
        return bedNum;
    }

    public long getTempleteId() {
        return templeteId;
    }

    public void setTempleteId(long templeteId) {
        this.templeteId = templeteId;
    }

    public void setBedNum(String bedNum) {
        this.bedNum = bedNum;
    }

    public String getHospNum() {
        if(hospNum == null || hospNum.isEmpty()){
            hospNum = HOSPNUM_DEFAULT;
        }
        return hospNum;
    }

    public void setHospNum(String hospNum) {
        this.hospNum = hospNum;
    }

    public List<FlowStep> getFlowStepList() {
        return flowStepList;
    }

    public void setFlowStepList(List<FlowStep> flowStepList) {
        this.flowStepList = flowStepList;
    }

    @Override
    public String toString() {
        return "Flow{" +
                "id=" + id +
                ", patientId=" + patientId +
                ", doctorId=" + doctorId +
                ", warningScore=" + warningScore +
                ", state=" + state +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", flowPatientName='" + flowPatientName + '\'' +
                ", description='" + description + '\'' +
                ", bedNum='" + bedNum + '\'' +
                ", hospNum='" + hospNum + '\'' +
                ", templeteId=" + templeteId +
                ", flowStepList=" + flowStepList +
                '}';
    }
}
